/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package bl;

import java.awt.Graphics2D;
import java.util.LinkedList;

/**
 *
 * @author Alexander
 */
public class BasicGraphicElement 
{
    private float posX;
    private float posY;
    private float width;
    private float height;
    private LinkedList<BasicGraphicElement> childElements;
    private boolean isPressed = false;
    private boolean isHovered;

    public BasicGraphicElement(float posX, float posY, float width, float height, LinkedList<BasicGraphicElement> childElements) {
        this.posX = posX;
        this.posY = posY;
        this.width = width;
        this.height = height;
        this.childElements = childElements;
    }

    public float getPosX() {
        return posX;
    }

    public void setPosX(float posX) {
        this.posX = posX;
    }

    public float getPosY() {
        return posY;
    }

    public void setPosY(float posY) {
        this.posY = posY;
    }

    public float getWidth() {
        return width;
    }

    public void setWidth(float width) {
        this.width = width;
    }

    public float getHeight() {
        return height;
    }

    public void setHeight(float height) {
        this.height = height;
    }

    public LinkedList<BasicGraphicElement> getChildElements() {
        return childElements;
    }

    public void setChildElements(LinkedList<BasicGraphicElement> childElements) {
        this.childElements = childElements;
    }
    
    public void addChildElement(BasicGraphicElement bge)
    {
        childElements.add(bge);
    }
    
    public boolean isIsPressed() {
        return isPressed;
    }

    public void setIsPressed(boolean isPressed) {
        this.isPressed = isPressed;
    }

    public boolean isIsHovered() {
        return isHovered;
    }

    public void setIsHovered(boolean isHovered) {
        this.isHovered = isHovered;
    }
    
    
    public void draw(Graphics2D g2d)
    {
        
        if(this.getChildElements() != null && !this.getChildElements().isEmpty())
        {
            for(BasicGraphicElement bge : childElements)
            {
                bge.draw(g2d);
            }
        }
    }

    
    
    public void onClick()
    {
        
    }
    public void onRelease()
    {
        
    }
    public void onEnter()
    {
        
    }
    public void onLeave()
    {
        
    }
}
